package com.pxx.pj.pxx.controller;

import com.pxx.pj.common.pojo.JsonResult;
import com.pxx.pj.common.pojo.Node;
import com.pxx.pj.pxx.pojo.PxxDepts;
import com.pxx.pj.pxx.service.PxxDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class PxxDeptsController {

@Autowired
    private PxxDeptService pxxDeptService;
@RequestMapping("dept/doFindObjects")
public JsonResult dofindObjects(){
    return new JsonResult(pxxDeptService.findObjects());
}
    @RequestMapping("dept/doDeleteObject")
    public JsonResult doDeleteObject(Integer id){
        pxxDeptService.deleteObject(id);
return new JsonResult("delete ok");
}
@RequestMapping("dept/doSaveObject")
public JsonResult doSaveObject(PxxDepts entity){
    pxxDeptService.saveObject(entity);
    return new JsonResult("save ok");
}
@RequestMapping("dept/doFindZTreeNodes")
public JsonResult doFindZTreeNodes(){
    return new JsonResult(pxxDeptService.findZTreeNodes());
}
@RequestMapping("dept/doUpdateObject")
public JsonResult doUpdateObject (PxxDepts entity){
    pxxDeptService.updateObject(entity);
    return new JsonResult("update ok");
}
}
